package com.zhuss.controller.meeting;

import com.zhuss.bean.bo.meeting.room.CreateRoomBo;
import com.zhuss.bean.bo.meeting.room.DeleteRoomBo;
import com.zhuss.bean.bo.meeting.room.UpdateRoomBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.exception.WpsException;
import com.zhuss.meeting.room.RoomOperateServiceExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhushanshuo
 * @Date: 2020/2/12 21:31
 */
@RestController
@RequestMapping("/room")
public class RoomOperateController extends BaseController{

    @Autowired
    @Qualifier("roomOperateService")
    private OperateService<Void, Object> roomOperateService;

    @Autowired
    @Qualifier("roomOperateServiceExt")
    private RoomOperateServiceExt roomOperateServiceExt;

    /**
     * 新建
     * @param bo
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateRoomBo bo) throws WpsException {
        roomOperateService.create(bo);
    }

    /**
     * 编辑
     * @param bo
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateRoomBo bo) throws WpsException {
        roomOperateService.update(bo);
    }

    /**
     * 删除
     * @param bo
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteRoomBo bo) throws WpsException {
        roomOperateService.delete(bo);
    }

}
